package dbmodels;

import java.util.UUID;

import dbtypes.PermisionPhoto;

public class Photo {

	private UUID id;
	private UUID albumid;
	private String name;
	private byte[] bytes;
	private PermisionPhoto permision;

	public UUID getId() {
		return id;
	}

	public void setId(UUID id) {
		this.id = id;
	}

	public UUID getAlbumid() {
		return albumid;
	}

	public void setAlbumid(UUID albumid) {
		this.albumid = albumid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public byte[] getBytes() {
		return bytes;
	}

	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}

	public PermisionPhoto getPermision() {
		return permision;
	}

	public void setPermision(PermisionPhoto permision) {
		this.permision = permision;
	}

	public boolean isValid() {
		name = name == null ? "" : name;

		name = name.trim();

		if (name.equals(""))
			return false;

		if(id == null)
			return false;
		
		if(permision == null)
			return false;
		
		if(albumid == null)
			return false;
		
		if(bytes == null)
			return false;
		
		return true;
	}

}
